package com.lanchetech.common.enums;

import lombok.Getter;

@Getter
public enum BonusCommissionEnum {
    MEMBER_LEVEL2(2,(byte)13,"主管","主管分红"),
    MEMBER_LEVEL3(3,(byte)14,"经理","经理分红"),
    MEMBER_LEVEL4(4,(byte)15,"总监","总监分红"),
    PARTNER_LEVEL2(6,(byte)16,"会长","会长分红"),
    PARTNER_LEVEL3(7,(byte)17,"合伙人副主席","副主席分红"),
    PARTNER_LEVEL4(8,(byte)18,"合伙人主席","主席分红"),
    SHAREHOLDER_LEVEL2(10,(byte)19,"副总裁","副总裁分红"),
    SHAREHOLDER_LEVEL3(11,(byte)20,"总裁","总裁分红"),
    SHAREHOLDER_LEVEL4(12,(byte)21,"董事","董事分红"),
    ;

    private Integer level;
    private Byte type;
    private String levelRemark;
    private String typeRemark;

    BonusCommissionEnum(Integer level, Byte type, String levelRemark, String typeRemark) {
        this.level = level;
        this.type = type;
        this.levelRemark = levelRemark;
        this.typeRemark = typeRemark;
    }

    public static Integer getLevel(Byte type) {
        for (BonusCommissionEnum item : BonusCommissionEnum.values()) {
            if (item.getType().equals(type)) {
                return item.getLevel();
            }
        }
        return null;
    }

    public static Byte getType(Integer level) {
        for (BonusCommissionEnum item : BonusCommissionEnum.values()) {
            if (item.getLevel().equals(level)) {
                return item.getType();
            }
        }
        return null;
    }
}
